package pattern.creational.singleton.classic;

/**
 * @author: chaoyang.ren  
 * @date:Jul 13, 2017  
 * @time:3:08:40 PM   
 * @email:chaoyang.ren@foxmail.com  
 * @version: 1.0
 */
public class SingletonClass {
	private long a = 0;
    static class SingletonClassHolder{
        static final SingletonClass INSTANCE = new SingletonClass();
    }
    
    public static SingletonClass getInstance(){
        return SingletonClassHolder.INSTANCE;
    }
    
    private SingletonClass(){}
    
    public long getCurrent(){
        return a;
    }
    
    public long getNext(){
        return a++;
    }
}

